Using Relative Paths


 

If you have been supplied a pre-built database, e.g. a CD-ROM of categorized images, you may have noticed that the source folders contain a % sign instead of a drive letter.  This % sign is a relative path, that is instead of using an exact path, e.g. 'd:\my pictures' the database will contain relative paths, e.g. '%:\my pictures' where the percentage sign is automatically replaced by the drive letter for your CD-ROM drive (though in actuality it does not need to be a CD-ROM drive, e.g. you could copy all your files to your hard drive and use that letter instead).  In this way other users of the same pre-built database don't need to relocate all their source folders to access the images they simply need to set this value.  

 

If you are planning to deploy a Smart Pix database on CD-ROM read these important tips.

 

 

Creating Relative Paths

 

If you are building a database of categorized images where you will supply the images and database to other users then it is advised that you use relative paths.

 

For example, let's say you have a set of images in C:\images that you will supply to users on CD-ROM, if you set the CD-ROM value to 'C' then your source folder will appear as %:\images.  If you then use the same folder structure on your CD-ROM then when you supply it to other users then Smart Pix will automatically replace the % with their drive letter so that they can access the images without having to configure their source folders.

 

 

An Example

 

Let's say that your source folders are currently:

 

C:\My Images\Cars\Porsche

C:\My Images\Cars\Ferrari

C:\My Images\Cars\Honda

 

You plan to copy these images and the Smart Pix database onto your CD-ROM.  The images will be in the folders of the CD-ROM at:

 

Z:\Cars\Porsche

Z:\Cars\Ferrari

Z:\Cars\Honda

 

Where Z represents your drive letter.

 

Here is the process:

 

1.Go into database settings using Database>Settings and Source Folders and select the Source Folders tab

2.If the value for 'CD-ROM Drive/Value of Wildcard' is not blank then clear it by clicking 'Clear Wildcard from all folders

3.Set the value for 'CD-ROM Drive/Value of Wildcard' to the part of the path name which will change, in our example it is C:\My Images

4.Click OK

5.You will be prompted if you want to set all of your folders to the new wildcard.  Click 'Yes'

6.Go back into Settings and Source Folders, Source Folders tab.  All of the folders that had the old path will now contain the wildcard symbol (%).  In our example, they would appear as:

 

%\Cars\Porsche

%\Cars\Ferrari

%\Cars\Honda

 

Now when you give your database CD to someone else, Smart Pix will automatically check for their CD-ROM drive and read all images from the CD-ROM location, for example, the image %\Cars\Porsche\boxster.jpg would be read as Z:\Cars\Porsche\boxster.jpg (assuming that there CD-ROM drive is Z)

 

 

Wildcards need not only be used for CD-ROMs, you might also use it if you frequently change the location of the images.  For example if you initially had the above folders but had changed the location to (Not using Smart Pix):

 

J:\Image Collection\Cars\Porsche

J:\Image Collection\Cars\Ferrari

J:\Image Collection\Cars\Honda

 

Then use the above steps 1-6 then when you have finished set the value of the wildcard to the new location  (in this example, 'J:\Image Collection')